﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using DAL.Entiteti;


namespace KSZ
{
    public partial class IgracControl : UserControl
    {
        Igrac Kobe_Bryant;
        Klub LAL = null;
        public IgracControl(Igrac i)
        {
                Kobe_Bryant = i;
               
                InitializeComponent();
        }

        private void IgracControl_Load(object sender, EventArgs e)
        {
            MessageBox.Show(Kobe_Bryant.DajIDKluba.ToString());
            DAL.DAL d1 = DAL.DAL.Instanca;
            d1.kreirajKonekciju("localhost", "mydb", "root", "FCChelsea1");
            DAL.DAL.KlubDAO cd1 = new DAL.DAL.KlubDAO();
            LAL = cd1.getById(Kobe_Bryant.DajIDKluba);
            d1.terminirajKonekciju();
            p_Igrac.ImageLocation = Kobe_Bryant.Slika;
            LL_Ime_Prezime.Text = Kobe_Bryant.ToString();
        }

        private void LL_Ime_Prezime_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            PregledIgraca pi = new PregledIgraca(Kobe_Bryant, LAL);
            pi.Show();
        }
    }
}
